package main

import (
	"fmt"
	"strconv"
)

func main() {
	var num1 int = 99
	var num2 float64 = 23.564
	var b bool = true
	var str string
	str = fmt.Sprint(num1)
	fmt.Printf("str type %T str = %v \n", str, str)
	str = fmt.Sprint(num2)
	fmt.Printf("str type %T str = %v \n", str, str)
	str = fmt.Sprint(b)
	fmt.Printf("str type %T str = %v \n", str, str)
	//第二种方式
	var num3 int = 99
	var num4 float64 = 23.456
	var b2 bool = true
	//base要求的进制
	str = strconv.FormatInt(int64(num3), 10)
	fmt.Printf("str type %T str = %v \n", str, str)
	//fmt:转成的格式
	//prec 精度 10表示小数位后保留10位
	//bitsize
	str = strconv.FormatFloat(num4, 'f', 10, 64)
	fmt.Printf("str type %T str = %v \n", str, str)
	str = strconv.FormatBool(b2)
	fmt.Printf("str type %T str = %v \n", str, str)

}
